<template>
	<SafeAreaNavBar>
		<NavBar :height="44" title="首页"></NavBar>
	</SafeAreaNavBar>
	<SafeAreaContent :offsetTop="44" :offsetBottom="44">
		<view class="container">
			<button type="default" @click="jump('/pages/login/login')">
				1111登录页
			</button>
			<button type="default" @click="jump('/pages/other/other')">其他页</button>
			<button type="default" @click="jump('/pages/tools/index')">工具页</button>
			<button type="default" @click="jump('/pages/tools/index')">工具页</button>
			<button type="default" @click="jump('/pages/tools/index')">工具页</button>
			<button type="default" @click="jump('/pages/tools/index')">工具页</button>
			<button type="default" @click="jump('/pages/tools/index')">工具页</button>
			<button type="default" @click="jump('/pages/tools/index')">工具页</button>
			<button type="default" @click="jump('/pages/tools/index')">工具页</button>
			<button type="default" @click="jump('/pages/tools/index')">工具页</button>
			<button type="default" @click="jump('/pages/tools/index')">工具页</button>
			<button type="default" @click="jump('/pages/tools/index')">工具页</button>
			<button type="default" @click="jump('/pages/tools/index')">工具页</button>
			<button type="default" @click="jump('/pages/tools/index')">工具页</button>
			<button type="default" @click="jump('/pages/tools/index')">工具页</button>
			<button type="default" @click="jump('/pages/tools/index')">工具页</button>
			<button type="default" @click="jump('/pages/tools/index')">工具页</button>
			<button type="default" @click="jump('/pages/tools/index')">工具页</button>
			<button type="default" @click="jump('/pages/tools/index')">工具页</button>
			<button type="default" @click="jump('/pages/tools/index')">工具页</button>
			<button type="default" @click="jump('/pages/tools/index')">工具页</button>
			<button type="default" @click="jump('/pages/tools/index')">工具页</button>
			<button type="default" @click="jump('/pages/tools/index')">工具页</button>
			<button type="default" @click="jump('/pages/tools/index')">工具页</button>
			<button type="default" @click="jump('/pages/tools/index')">工具页</button>
			<button type="default" @click="jump('/pages/tools/index')">工具页</button>
			<button type="default" @click="jump('/pages/tools/index')">工具页</button>
			<button type="default" @click="jump('/pages/tools/index')">工具页</button>
			<button type="default" @click="jump('/pages/tools/index')">工具页</button>
			<button type="default" @click="jump('/pages/tools/index')">工具页</button>
			<button type="default" @click="jump('/pages/tools/index')">工具页</button>
			<button type="default" @click="jump('/pages/tools/index')">工具页</button>
			<button type="default" @click="jump('/pages/tools/index')">工具页</button>
			<button type="default" @click="jump('/pages/tools/index')">工具页</button>
			<button type="default" @click="jump('/pages/tools/index')">工具页</button>
			<button type="default" @click="jump('/pages/tools/index')">工具页</button>
			<button type="default" @click="jump('/pages/tools/index')">工具页</button>
			<button type="default" @click="jump('/pages/tools/index')">工具页</button>
			<button type="default" @click="jump('/pages/tools/index')">工具页</button>
			<button type="default" @click="jump('/pages/tools/index')">工具页</button>
			<button type="default" @click="jump('/pages/tools/index')">工具页</button>
			<button type="default" @click="jump('/pages/tools/index')">工具页</button>
			<button type="default" @click="jump('/pages/tools/index')">工具页</button>
			<button type="default" @click="jump('/pages/tools/index')">工具页</button>
			<button type="default" @click="jump('/pages/tools/index')">工具页</button>
			<button type="default" @click="jump('/pages/tools/index')">工具页</button>
			<button type="default" @click="jump('/pages/tools/index')">工具页</button>
			<button type="default" @click="jump('/pages/tools/index')">工具页</button>
			<button type="default" @click="jump('/pages/tools/index')">工具页</button>
			<button type="default" @click="jump('/pages/tools/index')">工具页</button>
			<button type="default" @click="jump('/pages/tools/index')">工具页</button>
			<button type="default" @click="jump('/pages/tools/index')">工具页</button>
			<button type="default" @click="jump('/pages/tools/index')">工具页</button>
			<button type="default" @click="jump('/pages/tools/index')">
				000000000000000工具页
			</button>
			<!-- 已经在 pages.json 中 easycom 配置了，直接使用用即可 -->
			<!-- <my-pay></my-pay>
    <my-store-login></my-store-login> -->
			<!-- 使用通用滚动选择组件 -->
			<ScrollSelectList
				:list="selectedList"
				:modelValue="defaultValue"
				height="650rpx"
				:has-more="true"
				:loading="false"
				@change="handleChange"
				@load-more="loadMore"
			/>
		</view>
	</SafeAreaContent>
	<SafeAreaBotBar :offsetBottom="0">
		<button>Submit</button>
	</SafeAreaBotBar>
</template>

<script>
import useStore from '@/store/index';
import SafeAreaNavBar from '@/components/SafeAreaNavBar/SafeAreaNavBar.vue';
import SafeAreaContent from '@/components/SafeAreaContent/SafeAreaContent.vue';
import SafeAreaBotBar from '@/components/SafeAreaBotBar/SafeAreaBotBar.vue';
import { getSystemName } from '@/utils/system';
export default {
	components: {
		SafeAreaNavBar,
		SafeAreaContent,
		SafeAreaBotBar,
	},

	data() {
		return {
			scrollTop: 0,
			defaultOpt: {}, // 默认值, 传字符串格式的id（或数字格式的id，或者对象，对象中包含id和text字段）
			selectedList: [
				{
					id: '1',
					text: '列表项一',
				},
				{
					id: '2',
					text: '列表项二',
				},
			], // 选中列表
		};
	},
	onLoad() {
		const osName = getSystemName();
		console.log('当前系统:', osName);

		if (osName === 'iOS') {
			console.log('执行 iOS 支付逻辑');
		} else if (osName === 'Android') {
			console.log('执行 Android 支付逻辑');
		} else {
			console.log('H5 或其他平台');
		}
	},
	methods: {
		jump(url) {
			return this.$jump(url);
		},
		loadMore() {
			// 加载更多
			// 请求更多数据
			console.log('loadMore');
		},
		handleChange(e) {
			// 改变的值（或选中的值）
			console.log('e', e);
		},
	},
};
</script>

<style lang="scss" scoped>
.container {
	width: 100%;
	height: 100%;
}
</style>
